<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>升腾客户管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/X-admin/css/font.css">
    <link rel="stylesheet" href="/X-admin/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="/X-admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/X-admin/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
/*    div{
    width:200px;
    height:200px;
    border:2px red solid;
	}*/
	.box-a,.box-b{float:left;}
	.box-a{margin-left:350px}
	.box-b{margin-left:200px}
	#div1{float:left;}
	#div2{float:right;margin-left:500px}
	</style>
  </head>
  
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">会员审核</a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so layui-form-pane">
          <input class="layui-input" placeholder="输入手机号" name="mobile">
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon"></i>查询</button>
        </form>
      </div>
      {notempty name="member"}
      <form class="layui-form" action ="{:url('Admin/member/auditUpdate')}" method="post" id="myform">
      <div class="box-a">
		<input type="hidden" name="mid" value="{$member.mid}">
          <div class="layui-form-item">
		  <input type="hidden" name="id" value="{$member.mid}">
      <input type="hidden" name="id_name" value="">
      <input type="hidden" name="id_sex" value="">
      <input type="hidden" name="id_nation" value="">
      <input type="hidden" name="id_born" value="">
      <input type="hidden" name="id_address" value="">
      <input type="hidden" name="id_cardNo" value="">
      <input type="hidden" name="id_police" value="">
      <input type="hidden" name="id_pic" value="">
              <label for="name" class="layui-form-label">
                  <span class="x-red">*</span>真实姓名
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="name" name="real_name" required="" lay-verify="required"
                  autocomplete="off" value="{$member.real_name}" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="referee_name" class="layui-form-label">
                  推荐人
              </label>
              <div class="layui-input-inline">
                  <input type="referee_name" id="referee_name" name="referee_name" lay-verify="required" value="{$member.referee_name}" disabled
                  autocomplete="off" class="layui-input">
              </div>
          </div>
		  
          <div class="layui-form-item">
              <label for="id_card" class="layui-form-label">
                  身份证
              </label>
              <div class="layui-input-inline">
                  <input type="id_card" id="id_card" name="id_card" lay-verify="required" value="{$member.id_card}" 
                  autocomplete="off" class="layui-input">
              </div>
          </div>		  
          <div class="layui-form-item">
              <label for="referee_mobile" class="layui-form-label">
                  推荐人电话
              </label>
              <div class="layui-input-inline">
                  <input type="referee_mobile" id="referee_mobile" name="referee_mobile" lay-verify="required" value="{$member.referee_mobile}" disabled
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="mobile" class="layui-form-label">
                  <span class="x-red">*</span>手机
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="mobile" name="mobile" required="" lay-verify="required" disabled
                  autocomplete="off" value="{$member.mobile}" class="layui-input">
              </div>
              <div class="layui-form-mid layui-word-aux">
                  <span class="x-red">*</span>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="address" class="layui-form-label">
                  地址
              </label>
              <div class="layui-input-inline">
                  <input type="address" id="address" name="address" value="{$member.address}" disabled
                  autocomplete="off" class="layui-input">
              </div>

          </div>
          <div class="layui-form-item">
              <label for="silver_card" class="layui-form-label">
                  数据代码
              </label>
              <div class="layui-input-inline">
                  <input type="silver_card" id="silver_card" name="silver_card" lay-verify="required" value="{$member.silver_card}" disabled
                  autocomplete="off" class="layui-input">
              </div>

          </div>
          <div class="layui-form-item">
              <label for="bank_name" class="layui-form-label">
                  开户行
              </label>
              <div class="layui-input-inline">
                  <input type="bank_name" id="bank_name" name="bank_name" value="{$member.bank_name}" class="layui-input">
              </div>

          </div>
          <div class="layui-form-item">
              <label for="bank_card" class="layui-form-label">
                  银行账户
              </label>
              <div class="layui-input-inline">
                  <input type="bank_card" id="bank_card" name="bank_card" value="{$member.bank_card}" class="layui-input">
              </div>
          </div>		  
	</div>
	</form>
	<div class="box-b">
          <div class="layui-form-item">
              <label for="name" class="layui-form-label">
                  <span class="x-red">*</span>真实姓名
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="name1" name="Name" value="" class="layui-input">
              </div>
          </div>
  <object name="CVR_IDCard" width="0" height="0" id="CVR_IDCard" classid="clsid:10946843-7507-44FE-ACE8-2B3483D179B7"></object>

          <div class="layui-form-item">
              <label class="layui-form-label">
                  身份证
              </label>
              <div class="layui-input-inline">
                  <input type="id_card" id="id_card1" name="CardNo" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">
                  身份证地址
              </label>
              <div class="layui-input-inline">
                  <input type="address" id="address1" name="Address" class="layui-input">
              </div>
          </div>           
          <div class="layui-form-item">
              <label class="layui-form-label">
                  照片编码
              </label>
              <div class="layui-input-inline">
                 <TEXTAREA name=PhotoBuffer rows=4 cols=47></TEXTAREA>(照片数据流，要求为JPG文件数据流进行BASE64编码得到的字符串)
              </div>
          </div>
          <div class="layui-form-item">
              <label  class="layui-form-label">
                  头像
              </label>
              <div class="layui-input-inline">
                 <IMG style="WIDTH: 124px; HEIGHT: 150px" name=PhotoDisplay>
              </div>
          </div>
          	  
          <div class="layui-form-item">
              <label class="layui-form-label">
              </label>
			  <button  class="layui-btn" onclick="ReadIDCard()" id="id_care" name="ReadCard">
                  读身份证
              </button>
          </div>
	</div>
      <div class="layui-form-item" style="width:500px;margin: 0 auto;">
          <label for="repass">
          </label>
          <button  class="layui-btn" lay-filter="update" id="update" lay-submit="">
              修改
          </button>
		  <button  class="layui-btn" lay-filter="audit" id="audit" lay-submit="">
              审核通过
          </button>
		  <button  class="layui-btn" lay-filter="forbid" id="forbid" lay-submit="">
              不通过
          </button>
      </div>
  	{/notempty}
    </div>
    <script>
$(function(){
    $("#update").click(function(){
        var newUrl = '{:url('Admin/member/auditUpdate')}';    //设置新提交地址
        $("#myform").attr('action',newUrl);    //通过jquery为action属性赋值
        $("#myform").submit();    //提交ID为myform的表单
    })
	
	$("#audit").click(function(){
        var newUrl = '{:url('Admin/member/auditPost')}';    //设置新提交地址
        $("#myform").attr('action',newUrl);    //通过jquery为action属性赋值
        $("#myform").submit();    //提交ID为myform的表单
    })
	$("#forbid").click(function(){
        var newUrl = '{:url('Admin/member/forbid')}';    //设置新提交地址
        $("#myform").attr('action',newUrl);    //通过jquery为action属性赋值
        $("#myform").submit();    //提交ID为myform的表单
    })
})
function ReadIDCard() {  
   var ret = CVR_IDCard.ReadCard();
   if (ret == "0"){               
      fillForm();
      return;
   } 

   alert("读卡错误,错误原因:" + ret);
}

function fillForm() {   
  var pName=CVR_IDCard.Name; 
  var pSex=CVR_IDCard.Sex;
  var pNation=CVR_IDCard.Nation;
  var pBorn=CVR_IDCard.Born;
  var pAddress=CVR_IDCard.Address;
  var pCardNo=CVR_IDCard.CardNo;
  var pPolice=CVR_IDCard.IssuedAt;
  var pActivityLFrom=CVR_IDCard.EffectedDate; 
  var pActivityLTo=CVR_IDCard.ExpiredDate; 
  var pDeviceNo=CVR_IDCard.CardReaderId;
  var pPhotoBuffer=CVR_IDCard.Picture; 
  document.all['Name'].value = pName; 
  document.all['CardNo'].value = pCardNo; 
  document.all['Address'].value = pAddress; 
  document.all['PhotoBuffer'].value = pPhotoBuffer; 
  document.all['PhotoDisplay'].src = 'data:image/jpeg;base64,' + pPhotoBuffer; 
  var name=$('#name').val();    
  var id_card=$('#id_card').val();
  var address=$('#address').val();
  $('[name="id_name"]').val(pName);
  $('[name="id_sex"]').val(pSex);
  $('[name="id_nation"]').val(pNation);
  $('[name="id_born"]').val(pBorn);
  $('[name="id_address"]').val(pAddress);
  $('[name="id_cardNo"]').val(pCardNo);
  $('[name="id_police"]').val(pPolice);
  $('[name="id_pic"]').val('data:image/jpeg;base64,' + pPhotoBuffer);
  if((name!==pName)||(id_card!==pCardNo)||(address!==pAddress)){
   layer.open({                                  
            title: '提示',btn: ['是', '否'],
            content: '用户个人信息与身份证信息不符，请确认是否人证相符？',
            yes: function (layero, index) {
                $('#id_card').val(pCardNo);
                $('#address').val(pAddress);
                $('#name').val(pName);
            },
   })
  }
}

function clearForm() {
  document.all['Name'].value = ''; 
  document.all['Address'].value = ''; 
  document.all['CardNo'].value = ''; 
  document.all['PhotoBuffer'].value = ''; 
  document.all['PhotoDisplay'].src = ''; 
}

    </script>
  </body>

</html>